#include "strategy/Context.hpp"

Context::Context(strategy::StrategyType strategy)
{
    switch (strategy)
    {
    case strategy::StrategyType::Add:
        _strategy = std::make_shared<StrategyAdd>();
        break;
    case strategy::StrategyType::Sub:
        _strategy = std::make_shared<StrategySub>();
        break;
    default:
        ThrowCustomExceptionInstance("Strategy not supported");
    }
}


double Context::operator()(double a, double b) const {
    return _strategy->Calculate(a, b);
}
